/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package parse;

/**
 *
 * @author phong
 */
public abstract class Category {    
    
    String feature;

    public static final String OPT_BW = "\\";
    public static final String OPT_FW = "/";
    public static final String OPT_ANY = "*";
    
    public static final BasicCategory N = new BasicCategory("N");
    public static final BasicCategory NP = new BasicCategory("NP");
    public static final BasicCategory S = new BasicCategory("S");
    
    public static final Category IV = new ComplexCategory(OPT_ANY, S, NP);
    public static final Category TV = new ComplexCategory(OPT_ANY, new ComplexCategory(OPT_ANY, S, NP), NP);
    
    public static final Category NPMOD = new ComplexCategory(OPT_ANY, NP, NP);
    public static final Category NPNPMOD = new ComplexCategory(OPT_ANY, NP, NPMOD);
    
    public static final Category VPMOD = new ComplexCategory(OPT_ANY, 
                                                new ComplexCategory(OPT_BW, S, NP),
                                                new ComplexCategory(OPT_BW, S, NP));
    public static final Category ADJ = new ComplexCategory(OPT_ANY, N, N);
    
    public static final Category SMOD = new ComplexCategory(OPT_ANY, S, S);
    
    
    public abstract Category leftMostRemove(Category cat);
    
    public String getFeature() {
        return this.feature;
    }
    
    public abstract Category rightMostRemove(Category cat);
    
    public abstract int numOfAllBasicCats();
    
    public static void main(String[] args) {
        Category SbNP = new ComplexCategory(
                "backward", 
                new BasicCategory("S"), 
                new BasicCategory("NP"));
        Category SbNPfVP = new ComplexCategory(
                "forward", 
                SbNP, 
                new BasicCategory("VP"));
        
        System.out.println(SbNPfVP.rightMostRemove(new BasicCategory("VP")));
    }
    
}
